<?php
include 'util.php';

function changeGameStatus(){
	$fileName ='src\json\gameStatus.json';
	$myFile = file_get_contents($fileName);
	$gameStatusArray = json_decode(prepareJSON($myFile), true);
	// 修改游戏阶段：1：选英雄
	$gameStatusArray['gamePhase']= '1';
	file_put_contents($fileName,json_encode($gameStatusArray));
}
function shuffleHeroCards($userCount,$cardCount){
	$myFile = file_get_contents('src\json\heros.json');
	$myDataArr = json_decode(prepareJSON($myFile), true); 
	$cards = $myDataArr['standard'];
	shuffle($cards);
	shuffle($cards);
	shuffle($cards);
	$newCards = array();
	for($i=0;$i<$userCount*$cardCount;$i++){
		$newCards[$i]=$cards[$i]['id'];
	}
	var_dump($newCards);
	file_put_contents('src\temp\new_heros.json',json_encode($newCards));
	
	// 修改游戏状态->选择武将

	
	
}
shuffleHeroCards(6,3);
changeGameStatus();
?>